home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / wtek0693.zip / OOPALLEY.ZIP / LINKOB.CPP < prev    next >
C/C++ Source or Header  |  1993-04-27  |  924b  |  44 lines

  1. #include "linkob.h"
  2.  
  3. #define THIS    LinkOb
  4. #define BASE    Link
  5. DEFINE_CLASS(LinkOb,Link);
  6.  
  7. LinkOb::LinkOb(const Object& newval)
  8. {
  9.     val = (Object*)&newval;
  10. }
  11.  
  12. unsigned LinkOb::capacity() const     { return val->capacity(); }
  13.  
  14. int LinkOb::compare(const Object& ob) const  { return ob.compare(*val); }
  15.  
  16. void LinkOb::deepenShallowCopy()
  17. {
  18.     BASE::deepenShallowCopy();
  19.     val = val->deepCopy();
  20. }
  21.  
  22. unsigned LinkOb::hash() const        { return val->hash(); }
  23.  
  24. bool LinkOb::isEqual(const Object& ob) const
  25. {
  26.     return ob.isEqual(*val);
  27. }
  28.  
  29. void LinkOb::printOn(ostream& strm) const
  30. {
  31.     strm << className() << "("; val->printOn(strm); strm << ")";
  32. }
  33.  
  34. unsigned LinkOb::size() const         { return val->size(); }
  35.  
  36. Object* LinkOb::value() const { return val; }
  37.  
  38. Object* LinkOb::value(const Object& newval)
  39. {
  40.     Object* temp = val;
  41.     val = (Object*)&newval;
  42.     return temp;
  43. }
  44.